using System;
using System.Collections.Generic;
using System.Text;
using Mpi.Common.Collections;

namespace Xeml.Document
{
    //public class ValueCollection : ObservableIdCollectionBase<ValueBase, TimeSpan>
    //{

    //    protected override TimeSpan GetIdentifiere(ValueBase item)
    //    {
    //        return item.Time;
    //    }

    //    protected override void SetOwner(ValueBase item)
    //    {
    //        item.Collection = this;
    //    }

    //    protected override void RemoveOwner(ValueBase item)
    //    {
    //        item.Collection = null;
    //    }
    //}
    public class ValueCollection : ObservableIdCollectionBase<Value, string>
    {

        protected override string GetIdentifiere(Value item)
        {
            return item.Context;
        }

        protected override void SetOwner(Value item)
        {
            item.Collection = this;
        }

        protected override void RemoveOwner(Value item)
        {
            item.Collection = null;
        }
    }

    public class DynamicValueCollection : ObservableIdCollectionBase<DynamicValueBase, TimeSpan>
    {

        protected override TimeSpan GetIdentifiere(DynamicValueBase item)
        {
            return item.Time;
        }

        protected override void SetOwner(DynamicValueBase item)
        {
            item.Collection = this;
        }

        protected override void RemoveOwner(DynamicValueBase item)
        {
            item.Collection = null;
        }
    }
}
